package com.zc.utilclass.test;

import java.util.Date;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;

import com.zc.utilclass.servletutil.main.ServletUtil;

/**
 * Servlet implementation class EmployeeServlet
 */
@WebServlet("/EmployeeServlet")
public class EmployeeServlet extends ServletUtil {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public EmployeeServlet() {
        super();
    }

    // http://localhost:8080/ZcDWebClassUtil/EmployeeServlet?method=guyuan
    protected String guyuan() {
    	String str = "";
    	Date date = new Date();
    	Employee emp = new Employee(12, "张三", "经理", null, 10000);
    	str = emp.toString();
    	
    	return str;
    }

    // http://localhost:8080/ZcDWebClassUtil/EmployeeServlet?method=guyuan&a=你好
    protected String guyuan(String s) {
    	String str = "";
    	Date date = new Date();
    	Employee emp = new Employee(12, "张三", "经理", null, 10000);
    	str = emp.toString();
    	//
    	//System.out.println(s);
    	if(s.equals("你好")) {
    		System.out.println("你好");
    	}
    	return str+"\n"+s;
    }
    
    // http://localhost:8080/ZcDWebClassUtil/EmployeeServlet?method=guyuan&a=你好&b=12
    protected String guyuan(String s,String s2) {
    	String str = "";
    	Date date = new Date();
    	Employee emp = new Employee(12, "张三", "经理", null, 10000);
    	str = emp.toString();
    	//
    	//System.out.println(s);
    	if(s.equals("你好")) {
    		System.out.println("你好");
    	}
    	if(Integer.valueOf(s2)==12) {
    		System.out.println(12);
    	}
    	return str+" "+s+" "+s2;
    }
}
